Skip to content

Turbopack: scale down the Node.js pool after the module graph is built in production - #102211

Draft
lukesandberg wants to merge 4 commits into
canaryfrom
claude/scale-down-node-pool-after-module-graph
Draft

lukesandberg wants to merge 4 commits into
canaryfrom
claude/scale-down-node-pool-after-module-graph

Conversation

@lukesandberg

@lukesandberg lukesandberg commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What?

In production builds, Turbopack now shuts down its Node.js loader processes (the ones that run webpack loaders and PostCSS) as soon as the module graph is built, in cold and warm builds. Before, they stayed alive until next build exited.

Why?

These processes hold a lot of memory that is never used again. On a large app (vercel/front's next-site, 14 cores), 16–18 loader processes peak at ~7 GB combined during compilation. They kept ~3.4 GB through chunking, code generation, type checking, collecting page data and static generation, all memory-intensive phases. Build machines have more cores, so more of these processes.

How?

Project::whole_app_module_graphs scales the Node.js pool down after computing the module graph. There were two problems:

  • Cold builds: in production it only connect()ed the graph operation, which doesn't wait for it. So the scale-down ran before the graph's loaders had spawned any processes. Both modes now wait with resolve().strongly_consistent(), as dev already did. They return the resolved Vc, which is already connected, so production issues still reach the caller.
  • Warm builds: with the persistent cache, a changed module's loader runs again, but neither whole_app_module_graphs nor the graph operation executes again, even when an import changed. So the scale-down never ran. Both module-graph functions are now session_dependent, so they execute once per session. Re-executing is cheap: the graph is read from the cache and the returned cell only changes if the graph did.

Also:

  • The pool is scaled down even when computing the graph fails.
  • NodeBackend::scale_down/scale_zero, and the worker-pool operations behind them, are infallible. They never returned an error.
  • project_shutdown debug-asserts that no idle Node.js processes are left in builds that don't watch the file system.

test/production/app-dir/webpack-loader-traced-imports counts the build process's own loader processes from compiler.runAfterProductionCompile, after a cold build and after a warm rebuild with an edited page.

Verification

  • With release natives built from this branch: the cold-build test fails without the first commit ("Expected 0, Received 1"), and the warm-build test fails without session_dependent ("Expected 0, Received 2"). Both pass with the full change. They're skipped under webpack and on Windows.

  • pnpm test-dev-turbo test/e2e/turbopack-loader-config test/development/app-dir/turbopack-loader-file-dependencies (existing tests, dev loaders unaffected)

  • A Turbopack trace (NEXT_TURBOPACK_TRACING=turbo-tasks, with trace_task_dirty enabled for the trial) shows whole_app_module_graphs executing in warm builds (activate_dirty) after the edited module's evaluate_webpack_loader.

  • On next-site in vercel/front, 3 interleaved cold next build runs each with and without the first commit. Loader processes were counted from ps every 200 ms.

    max loader processes last one alive alive 30 s into the build
    before 16 / 18 / 17 at build exit (60.1 / 89.0 / 63.2 s) all
    after 18 / 18 / 16 19.0 / 22.0 / 22.5 s (before "Compiled successfully") none

    No process was respawned later in the build. Compile and static generation times were within this machine's noise.

  • cargo clippy -p turbopack-node with process_pool, worker_pool, and both; cargo clippy -p next-api -p next-napi-bindings

  • Not run: the new debug assertion at runtime (a debug native build didn't fit on disk).

…t in production

In production builds, whole_app_module_graphs connected the module graph
operation without waiting for it, then scaled the Node.js process pool to
zero. The scale-down ran before the graph's loaders had spawned any
processes, so they all stayed alive until the build exited. Wait for the
graph first, as development mode already does.
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Vercel Agent finished reviewing your changes and found no open issues.
8f27b96 • Mon, 23 Nov 2026 03:25:50 GMT • 56.8s • Details

Checked (6)

     Check Location
The production pool-lifetime fix has no regression test, so moving shutdown ahead of loader completion again would leave the reported multi-gigabyte memory retention undetected by CI.
Resolved in 21766c4: the production loader fixture now checks that loader processes have exited at the post-compilation hook, before the build exits.
project.rs:1861
In debug builds, shutdown can deadlock when idle_process_count holds ACTIVE_POOLS while a concurrent pool operation holds its heap lock and waits for ACTIVE_POOLS.
Resolved in 8f27b96: idle_process_count now snapshots the queue list and releases ACTIVE_POOLS before acquiring heap locks, removing the lock-order inversion.
mod.rs:870
The idle-process counter releases the active-pool list lock before taking heap locks.
Traced the cloned Arc list and statement-scoped guard against HeapQueue::push, pop and reduce_to_zero, which acquire locks in the opposite order.
mod.rs:870
Both graph entry points attempt pool scale-down before propagating graph computation errors.
Traced the retained graph Result through scale_down_node_pool and its subsequent question-mark propagation in both functions.
project.rs:1847
Development issue dropping remains conditional on non-production mode.
Verified drop_issues is guarded by !is_production and the issue-collection variant never calls it.
project.rs:1871
The regression hook distinguishes a live matching loader child from an exited child.
Executed the actual hook with a matching Node child; asserted counts of 1 while alive and 0 after termination.
next.config.mjs:12
Review steps

     Step Time
Preparing the workspace 11.7s
Analyzing the changes 36.5s
Finalizing the review 8.6s

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Failing test suites

Commit: 8f27b96 | About building and testing Next.js

pnpm test-dev-experimental-turbo test/e2e/app-dir/next-analyze-source-maps/next-analyze-source-maps.test.ts (turbopack) (Experimental) (job)

  • next analyze source maps > preserves emitted assets with none source maps (DD)
  • next analyze source maps > preserves emitted assets with shallow source maps (DD)
Expand output

● next analyze source maps › preserves emitted assets with none source maps

expect(received).toEqual(expected) // deep equality

- Expected  -  2
+ Received  + 53

- ObjectContaining {
-   "exitCode": 0,
+ Object {
+   "cliOutput": "▲ Next.js 16.5.0-canary.61 (Turbopack)
+ ⚠ `cacheComponents` is enabled without a corresponding `partialPrefetching` option. Set `partialPrefetching` to either `true` or `false`.
+
+ The only reason to set `partialPrefetching` to `false` is if you're migrating an older Cache Components app. The initial release of Cache Components did not include Partial Prefetching. New projects should enable both Cache Components and Partial Prefetching.
+
+ Both Cache Components and Partial Prefetching will be enabled everywhere in the next major release, and the old configurations will be removed.
+
+ Learn more: https://nextjs.org/docs/app/guides/adopting-partial-prefetching
+ ✓ Running next.config.js took 39ms
+ - Cache Components enabled
+ - Experiments (use with caution):
+   ✓ cachedNavigations (enabled by `__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS`)
+   ✓ serverComponentsHmrCancellation (enabled by `__NEXT_EXPERIMENTAL_SERVER_COMPONENTS_HMR_CANCELLATION`)
+   ⨯ turbopackInputSourceMaps
+   ⨯ turbopackSourceMaps
+
+   Creating an optimized production build ...
+
+ thread 'tokio-rt-worker' (46607) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
+ 1 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
+ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
+ ✓ Compiled successfully in 1342ms
+ unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }
+ ",
+   "code": 1,
+   "exitCode": 1,
+   "signal": null,
+   "stderr": "⚠ `cacheComponents` is enabled without a corresponding `partialPrefetching` option. Set `partialPrefetching` to either `true` or `false`.
+
+ The only reason to set `partialPrefetching` to `false` is if you're migrating an older Cache Components app. The initial release of Cache Components did not include Partial Prefetching. New projects should enable both Cache Components and Partial Prefetching.
+
+ Both Cache Components and Partial Prefetching will be enabled everywhere in the next major release, and the old configurations will be removed.
+
+ Learn more: https://nextjs.org/docs/app/guides/adopting-partial-prefetching
+
+ thread 'tokio-rt-worker' (46607) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
+ 1 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
+ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
+ unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }
+ ",
+   "stdout": "▲ Next.js 16.5.0-canary.61 (Turbopack)
+ ✓ Running next.config.js took 39ms
+ - Cache Components enabled
+ - Experiments (use with caution):
+   ✓ cachedNavigations (enabled by `__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS`)
+   ✓ serverComponentsHmrCancellation (enabled by `__NEXT_EXPERIMENTAL_SERVER_COMPONENTS_HMR_CANCELLATION`)
+   ⨯ turbopackInputSourceMaps
+   ⨯ turbopackSourceMaps
+
+   Creating an optimized production build ...
+ ✓ Compiled successfully in 1342ms
+ ",
  }

  57 |         }
  58 |         const normal = await next.runCommand(['build'], { env })
> 59 |         expect(normal).toEqual(expect.objectContaining({ exitCode: 0 }))
     |                        ^
  60 |         const normalAssets = readBuildAssets()
  61 |         expect(
  62 |           Object.keys(normalAssets).some((file) => file.endsWith('.css'))

  at toEqual (e2e/app-dir/next-analyze-source-maps/next-analyze-source-maps.test.ts:59:24)

● next analyze source maps › preserves emitted assets with shallow source maps

expect(received).toEqual(expected) // deep equality

- Expected  -  2
+ Received  + 53

- ObjectContaining {
-   "exitCode": 0,
+ Object {
+   "cliOutput": "▲ Next.js 16.5.0-canary.61 (Turbopack)
+ ⚠ `cacheComponents` is enabled without a corresponding `partialPrefetching` option. Set `partialPrefetching` to either `true` or `false`.
+
+ The only reason to set `partialPrefetching` to `false` is if you're migrating an older Cache Components app. The initial release of Cache Components did not include Partial Prefetching. New projects should enable both Cache Components and Partial Prefetching.
+
+ Both Cache Components and Partial Prefetching will be enabled everywhere in the next major release, and the old configurations will be removed.
+
+ Learn more: https://nextjs.org/docs/app/guides/adopting-partial-prefetching
+ ✓ Running next.config.js took 38ms
+ - Cache Components enabled
+ - Experiments (use with caution):
+   ✓ cachedNavigations (enabled by `__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS`)
+   ✓ serverComponentsHmrCancellation (enabled by `__NEXT_EXPERIMENTAL_SERVER_COMPONENTS_HMR_CANCELLATION`)
+   ⨯ turbopackInputSourceMaps
+   ✓ turbopackSourceMaps
+
+   Creating an optimized production build ...
+
+ thread 'tokio-rt-worker' (47111) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
+ 1 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
+ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
+ ✓ Compiled successfully in 1705ms
+ unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }
+ ",
+   "code": 1,
+   "exitCode": 1,
+   "signal": null,
+   "stderr": "⚠ `cacheComponents` is enabled without a corresponding `partialPrefetching` option. Set `partialPrefetching` to either `true` or `false`.
+
+ The only reason to set `partialPrefetching` to `false` is if you're migrating an older Cache Components app. The initial release of Cache Components did not include Partial Prefetching. New projects should enable both Cache Components and Partial Prefetching.
+
+ Both Cache Components and Partial Prefetching will be enabled everywhere in the next major release, and the old configurations will be removed.
+
+ Learn more: https://nextjs.org/docs/app/guides/adopting-partial-prefetching
+
+ thread 'tokio-rt-worker' (47111) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
+ 1 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
+ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
+ unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }
+ ",
+   "stdout": "▲ Next.js 16.5.0-canary.61 (Turbopack)
+ ✓ Running next.config.js took 38ms
+ - Cache Components enabled
+ - Experiments (use with caution):
+   ✓ cachedNavigations (enabled by `__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS`)
+   ✓ serverComponentsHmrCancellation (enabled by `__NEXT_EXPERIMENTAL_SERVER_COMPONENTS_HMR_CANCELLATION`)
+   ⨯ turbopackInputSourceMaps
+   ✓ turbopackSourceMaps
+
+   Creating an optimized production build ...
+ ✓ Compiled successfully in 1705ms
+ ",
  }

  57 |         }
  58 |         const normal = await next.runCommand(['build'], { env })
> 59 |         expect(normal).toEqual(expect.objectContaining({ exitCode: 0 }))
     |                        ^
  60 |         const normalAssets = readBuildAssets()
  61 |         expect(
  62 |           Object.keys(normalAssets).some((file) => file.endsWith('.css'))

  at toEqual (e2e/app-dir/next-analyze-source-maps/next-analyze-source-maps.test.ts:59:24)

pnpm test-start-experimental-turbo test/e2e/app-dir/turbopack-portable-build-cache/turbopack-portable-build-cache.test.ts (turbopack) (Experimental) (job)

  • turbopack-portable-build-cache > minimal app > reuses the build cache after moving the project (DD)
  • turbopack-portable-build-cache > monorepo with all features > reuses the build cache after moving the project (DD)
Expand output

● turbopack-portable-build-cache › minimal app › reuses the build cache after moving the project

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `turbopack-portable-build-cache minimal app reuses the build cache after moving the project 1`

- Snapshot  - 0
+ Received  + 1

@@ -1,8 +1,9 @@
  [
    "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::raw_read_dir",
    "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::read",
+   "next_api::project::Project::whole_app_module_graphs",
    "next_api::project::ProjectContainer::project",
    "next_api::project::project_root_path_operation",
    "next_napi_bindings::next_api::project::emit_all_output_assets_once_with_issues_operation",
    "next_napi_bindings::next_api::project::get_all_written_entrypoints_with_issues_operation",
    "next_napi_bindings::next_api::project::write_dist_dir_files_operation",

  74 |
  75 |       const sameDir = await buildWithTaskStatistics(next)
> 76 |       expect(executedFunctions(sameDir.stats)).toMatchInlineSnapshot(`
     |                                                ^
  77 |        [
  78 |          "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::raw_read_dir",
  79 |          "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::read",

  at Object.toMatchInlineSnapshot (e2e/app-dir/turbopack-portable-build-cache/turbopack-portable-build-cache.test.ts:76:48)

● turbopack-portable-build-cache › minimal app › reuses the build cache after moving the project

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `turbopack-portable-build-cache minimal app reuses the build cache after moving the project 2`

- Snapshot  - 0
+ Received  + 1

@@ -4,10 +4,11 @@
    "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks::display::ValueToString>::to_string",
    "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::raw_read_dir",
    "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::read",
    "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::write",
    "next_api::operation::entrypoints_without_collectibles_operation_turbo_tasks_function_inline::{{closure}}::inner_entrypoints_without_collectibles_operation",
+   "next_api::project::Project::whole_app_module_graphs",
    "next_api::project::ProjectContainer::project",
    "next_api::project::project_root_path_operation",
    "next_core::next_config::NextConfig::*",
    "next_napi_bindings::next_api::project::emit_all_output_assets_once_with_issues_operation",
    "next_napi_bindings::next_api::project::get_all_written_entrypoints_with_issues_operation",

  89 |       await moveProject(next, next.testDir)
  90 |       const moved = await buildWithTaskStatistics(next)
> 91 |       expect(executedFunctions(moved.stats)).toMatchInlineSnapshot(`
     |                                              ^
  92 |        [
  93 |          "<next_api::next_server_nft::ServerNftJsonAsset as dyn turbopack_core::asset::Asset>::content",
  94 |          "<next_api::nft_json::NftJsonAsset as dyn turbopack_core::asset::Asset>::content",

  at Object.toMatchInlineSnapshot (e2e/app-dir/turbopack-portable-build-cache/turbopack-portable-build-cache.test.ts:91:46)

● turbopack-portable-build-cache › monorepo with all features › reuses the build cache after moving the project

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `turbopack-portable-build-cache monorepo with all features reuses the build cache after moving the project 1`

- Snapshot  - 0
+ Received  + 1

@@ -1,10 +1,11 @@
  [
    "<turbo_tasks_env::EnvMap as dyn turbo_tasks_env::ProcessEnv>::read_all",
    "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::raw_read_dir",
    "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::read",
    "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::read_link",
+   "next_api::project::Project::whole_app_module_graphs",
    "next_api::project::ProjectContainer::project",
    "next_api::project::project_root_path_operation",
    "next_napi_bindings::next_api::project::emit_all_output_assets_once_with_issues_operation",
    "next_napi_bindings::next_api::project::get_all_written_entrypoints_with_issues_operation",
    "next_napi_bindings::next_api::project::write_dist_dir_files_operation",

  206 |
  207 |       const sameDir = await buildWithTaskStatistics(next)
> 208 |       expect(executedFunctions(sameDir.stats)).toMatchInlineSnapshot(`
      |                                                ^
  209 |        [
  210 |          "<turbo_tasks_env::EnvMap as dyn turbo_tasks_env::ProcessEnv>::read_all",
  211 |          "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::raw_read_dir",

  at Object.toMatchInlineSnapshot (e2e/app-dir/turbopack-portable-build-cache/turbopack-portable-build-cache.test.ts:208:48)

● turbopack-portable-build-cache › monorepo with all features › reuses the build cache after moving the project

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `turbopack-portable-build-cache monorepo with all features reuses the build cache after moving the project 2`

- Snapshot  - 0
+ Received  + 1

@@ -6,10 +6,11 @@
    "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::raw_read_dir",
    "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::read",
    "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::read_link",
    "<turbo_tasks_fs::disk::DiskFileSystem as dyn turbo_tasks_fs::FileSystem>::write",
    "next_api::operation::entrypoints_without_collectibles_operation_turbo_tasks_function_inline::{{closure}}::inner_entrypoints_without_collectibles_operation",
+   "next_api::project::Project::whole_app_module_graphs",
    "next_api::project::ProjectContainer::project",
    "next_api::project::project_root_path_operation",
    "next_core::next_config::NextConfig::*",
    "next_napi_bindings::next_api::project::emit_all_output_assets_once_with_issues_operation",
    "next_napi_bindings::next_api::project::get_all_written_entrypoints_with_issues_operation",

  226 |       const moved = await buildWithTaskStatistics(next)
  227 |       await expectAllFeatures(moved.cliOutput)
> 228 |       expect(executedFunctions(moved.stats)).toMatchInlineSnapshot(`
      |                                              ^
  229 |        [
  230 |          "<next_api::next_server_nft::ServerNftJsonAsset as dyn turbopack_core::asset::Asset>::content",
  231 |          "<next_api::nft_json::NftJsonAsset as dyn turbopack_core::asset::Asset>::content",

  at Object.toMatchInlineSnapshot (e2e/app-dir/turbopack-portable-build-cache/turbopack-portable-build-cache.test.ts:228:46)

pnpm test-start-experimental-turbo test/production/app-dir/webpack-loader-traced-imports/webpack-loader-traced-imports.test.ts (turbopack) (Experimental) (job)

  • webpack-loader-traced-imports > stops loader processes after compilation in a warm build (DD)
Expand output

● webpack-loader-traced-imports › stops loader processes after compilation in a warm build

RustPanicError: The next build output contains a Rust panic or a fatal Turbopack error. Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.

thread 'tokio-rt-worker' (119989) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
1 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
✓ Compiled successfully in 149ms
  Running next.config.js provided runAfterProductionCompile ...
unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }

  982 |       return
  983 |     }
> 984 |     throw new RustPanicError(
      |           ^
  985 |       `The ${processName} output contains a Rust panic or a fatal Turbopack error. ` +
  986 |         'Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.\n\n' +
  987 |         lines.slice(index, index + 1 + RUST_PANIC_CONTEXT_LINES).join('\n'),

  at NextStartInstance.throwOnRustPanics (lib/next-modes/base.ts:984:11)
  at NextStartInstance.throwOnRustPanics [as build] (lib/next-modes/next-start.ts:308:10)
  at Object.<anonymous> (production/app-dir/webpack-loader-traced-imports/webpack-loader-traced-imports.test.ts:35:26)
  at Object.gatedBody (lib/gate/runtime.ts:280:7)

pnpm test-start-experimental-turbo test/e2e/deferred-entries/deferred-entries.test.ts (turbopack) (Experimental) (job)

  • deferred-entries > should build deferred entry successfully (DD)
  • deferred-entries > should render timestamp written by onBeforeDeferredEntries in deferred source file (DD)
  • deferred-entries > should build pages router routes when using deferred entries (DD)
  • deferred-entries > should build pages router getStaticProps routes when using deferred entries (DD)
  • deferred-entries > should build pages router dynamic getStaticPaths/getStaticProps route when using deferred entries (DD)
  • deferred-entries > should build pages router getServerSideProps route when using deferred entries (DD)
  • deferred-entries > should build pages router route with no data fetching when using deferred entries (DD)
  • deferred-entries > should build pages router dynamic and catch-all routes when using deferred entries (DD)
  • deferred-entries > should build app router dynamic route with generateStaticParams when using deferred entries (DD)
  • deferred-entries > should build app router route in a route group when using deferred entries (DD)
  • deferred-entries > should build app router parallel routes when using deferred entries (DD)
  • deferred-entries > should build app router dynamic and catch-all routes when using deferred entries (DD)
  • deferred-entries > should build app router route handler when using deferred entries (DD)
  • deferred-entries > should build app router metadata routes when using deferred entries (DD)
  • deferred-entries > should render app router current time on every request (DD)
  • deferred-entries > should build pages router API routes when using deferred entries (DD)
  • deferred-entries > should build pages router dynamic API routes when using deferred entries (DD)
  • deferred-entries > should run middleware for app router, pages router, and API routes (DD)
  • deferred-entries > should run instrumentation hooks with deferred entries (DD)
  • deferred-entries > should call onBeforeDeferredEntries before building deferred entry (DD)
  • deferred-entries > should call onBeforeDeferredEntries before processing deferred entries during build (DD)
Expand output

● deferred-entries › should build deferred entry successfully

RustPanicError: The next build output contains a Rust panic or a fatal Turbopack error. Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.

thread 'tokio-rt-worker' (53887) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
2 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
✓ Compiled successfully in 4.7s
unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }

  982 |       return
  983 |     }
> 984 |     throw new RustPanicError(
      |           ^
  985 |       `The ${processName} output contains a Rust panic or a fatal Turbopack error. ` +
  986 |         'Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.\n\n' +
  987 |         lines.slice(index, index + 1 + RUST_PANIC_CONTEXT_LINES).join('\n'),

  at NextStartInstance.throwOnRustPanics (lib/next-modes/base.ts:984:11)
  at NextStartInstance.throwOnRustPanics [as start] (lib/next-modes/next-start.ts:165:14)
  at Object.<anonymous> (e2e/deferred-entries/deferred-entries.test.ts:144:5)

Cause:
next build failed with code/signal 1

  135 |             if (code || signal)
  136 |               reject(
> 137 |                 new Error(
      |                 ^
  138 |                   `next build failed with code/signal ${code || signal}`
  139 |                 )
  140 |               )

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:137:17)

● deferred-entries › should render timestamp written by onBeforeDeferredEntries in deferred source file

RustPanicError: The next build output contains a Rust panic or a fatal Turbopack error. Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.

thread 'tokio-rt-worker' (53887) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
2 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
✓ Compiled successfully in 4.7s
unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }

  982 |       return
  983 |     }
> 984 |     throw new RustPanicError(
      |           ^
  985 |       `The ${processName} output contains a Rust panic or a fatal Turbopack error. ` +
  986 |         'Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.\n\n' +
  987 |         lines.slice(index, index + 1 + RUST_PANIC_CONTEXT_LINES).join('\n'),

  at NextStartInstance.throwOnRustPanics (lib/next-modes/base.ts:984:11)
  at NextStartInstance.throwOnRustPanics [as start] (lib/next-modes/next-start.ts:165:14)
  at Object.<anonymous> (e2e/deferred-entries/deferred-entries.test.ts:144:5)

Cause:
next build failed with code/signal 1

  135 |             if (code || signal)
  136 |               reject(
> 137 |                 new Error(
      |                 ^
  138 |                   `next build failed with code/signal ${code || signal}`
  139 |                 )
  140 |               )

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:137:17)

● deferred-entries › should build pages router routes when using deferred entries

RustPanicError: The next build output contains a Rust panic or a fatal Turbopack error. Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.

thread 'tokio-rt-worker' (53887) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
2 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
✓ Compiled successfully in 4.7s
unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }

  982 |       return
  983 |     }
> 984 |     throw new RustPanicError(
      |           ^
  985 |       `The ${processName} output contains a Rust panic or a fatal Turbopack error. ` +
  986 |         'Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.\n\n' +
  987 |         lines.slice(index, index + 1 + RUST_PANIC_CONTEXT_LINES).join('\n'),

  at NextStartInstance.throwOnRustPanics (lib/next-modes/base.ts:984:11)
  at NextStartInstance.throwOnRustPanics [as start] (lib/next-modes/next-start.ts:165:14)
  at Object.<anonymous> (e2e/deferred-entries/deferred-entries.test.ts:144:5)

Cause:
next build failed with code/signal 1

  135 |             if (code || signal)
  136 |               reject(
> 137 |                 new Error(
      |                 ^
  138 |                   `next build failed with code/signal ${code || signal}`
  139 |                 )
  140 |               )

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:137:17)

● deferred-entries › should build pages router getStaticProps routes when using deferred entries

RustPanicError: The next build output contains a Rust panic or a fatal Turbopack error. Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.

thread 'tokio-rt-worker' (53887) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
2 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
✓ Compiled successfully in 4.7s
unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }

  982 |       return
  983 |     }
> 984 |     throw new RustPanicError(
      |           ^
  985 |       `The ${processName} output contains a Rust panic or a fatal Turbopack error. ` +
  986 |         'Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.\n\n' +
  987 |         lines.slice(index, index + 1 + RUST_PANIC_CONTEXT_LINES).join('\n'),

  at NextStartInstance.throwOnRustPanics (lib/next-modes/base.ts:984:11)
  at NextStartInstance.throwOnRustPanics [as start] (lib/next-modes/next-start.ts:165:14)
  at Object.<anonymous> (e2e/deferred-entries/deferred-entries.test.ts:144:5)

Cause:
next build failed with code/signal 1

  135 |             if (code || signal)
  136 |               reject(
> 137 |                 new Error(
      |                 ^
  138 |                   `next build failed with code/signal ${code || signal}`
  139 |                 )
  140 |               )

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:137:17)

● deferred-entries › should build pages router dynamic getStaticPaths/getStaticProps route when using deferred entries

RustPanicError: The next build output contains a Rust panic or a fatal Turbopack error. Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.

thread 'tokio-rt-worker' (53887) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
2 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
✓ Compiled successfully in 4.7s
unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }

  982 |       return
  983 |     }
> 984 |     throw new RustPanicError(
      |           ^
  985 |       `The ${processName} output contains a Rust panic or a fatal Turbopack error. ` +
  986 |         'Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.\n\n' +
  987 |         lines.slice(index, index + 1 + RUST_PANIC_CONTEXT_LINES).join('\n'),

  at NextStartInstance.throwOnRustPanics (lib/next-modes/base.ts:984:11)
  at NextStartInstance.throwOnRustPanics [as start] (lib/next-modes/next-start.ts:165:14)
  at Object.<anonymous> (e2e/deferred-entries/deferred-entries.test.ts:144:5)

Cause:
next build failed with code/signal 1

  135 |             if (code || signal)
  136 |               reject(
> 137 |                 new Error(
      |                 ^
  138 |                   `next build failed with code/signal ${code || signal}`
  139 |                 )
  140 |               )

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:137:17)

● deferred-entries › should build pages router getServerSideProps route when using deferred entries

RustPanicError: The next build output contains a Rust panic or a fatal Turbopack error. Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.

thread 'tokio-rt-worker' (53887) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
2 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
✓ Compiled successfully in 4.7s
unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }

  982 |       return
  983 |     }
> 984 |     throw new RustPanicError(
      |           ^
  985 |       `The ${processName} output contains a Rust panic or a fatal Turbopack error. ` +
  986 |         'Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.\n\n' +
  987 |         lines.slice(index, index + 1 + RUST_PANIC_CONTEXT_LINES).join('\n'),

  at NextStartInstance.throwOnRustPanics (lib/next-modes/base.ts:984:11)
  at NextStartInstance.throwOnRustPanics [as start] (lib/next-modes/next-start.ts:165:14)
  at Object.<anonymous> (e2e/deferred-entries/deferred-entries.test.ts:144:5)

Cause:
next build failed with code/signal 1

  135 |             if (code || signal)
  136 |               reject(
> 137 |                 new Error(
      |                 ^
  138 |                   `next build failed with code/signal ${code || signal}`
  139 |                 )
  140 |               )

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:137:17)

● deferred-entries › should build pages router route with no data fetching when using deferred entries

RustPanicError: The next build output contains a Rust panic or a fatal Turbopack error. Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.

thread 'tokio-rt-worker' (53887) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
2 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
✓ Compiled successfully in 4.7s
unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }

  982 |       return
  983 |     }
> 984 |     throw new RustPanicError(
      |           ^
  985 |       `The ${processName} output contains a Rust panic or a fatal Turbopack error. ` +
  986 |         'Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.\n\n' +
  987 |         lines.slice(index, index + 1 + RUST_PANIC_CONTEXT_LINES).join('\n'),

  at NextStartInstance.throwOnRustPanics (lib/next-modes/base.ts:984:11)
  at NextStartInstance.throwOnRustPanics [as start] (lib/next-modes/next-start.ts:165:14)
  at Object.<anonymous> (e2e/deferred-entries/deferred-entries.test.ts:144:5)

Cause:
next build failed with code/signal 1

  135 |             if (code || signal

... truncated ...

pnpm test-start test/production/app-dir/webpack-loader-traced-imports/webpack-loader-traced-imports.test.ts (job)

  • webpack-loader-traced-imports > stops loader processes after compilation in a warm build (DD)
Expand output

● webpack-loader-traced-imports › stops loader processes after compilation in a warm build

RustPanicError: The next build output contains a Rust panic or a fatal Turbopack error. Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.

thread 'tokio-rt-worker' (5937) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
1 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
✓ Compiled successfully in 151ms
  Running next.config.js provided runAfterProductionCompile ...
unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }

  982 |       return
  983 |     }
> 984 |     throw new RustPanicError(
      |           ^
  985 |       `The ${processName} output contains a Rust panic or a fatal Turbopack error. ` +
  986 |         'Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.\n\n' +
  987 |         lines.slice(index, index + 1 + RUST_PANIC_CONTEXT_LINES).join('\n'),

  at NextStartInstance.throwOnRustPanics (lib/next-modes/base.ts:984:11)
  at NextStartInstance.throwOnRustPanics [as build] (lib/next-modes/next-start.ts:308:10)
  at Object.<anonymous> (production/app-dir/webpack-loader-traced-imports/webpack-loader-traced-imports.test.ts:35:26)
  at Object.gatedBody (lib/gate/runtime.ts:280:7)

pnpm test-start test/production/app-dir/webpack-loader-traced-imports/webpack-loader-traced-imports.test.ts (job)

  • webpack-loader-traced-imports > stops loader processes after compilation in a warm build (DD)
Expand output

● webpack-loader-traced-imports › stops loader processes after compilation in a warm build

RustPanicError: The next build output contains a Rust panic or a fatal Turbopack error. Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.

thread 'tokio-rt-worker' (5969) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
1 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
✓ Compiled successfully in 174ms
  Running next.config.js provided runAfterProductionCompile ...
unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }

  982 |       return
  983 |     }
> 984 |     throw new RustPanicError(
      |           ^
  985 |       `The ${processName} output contains a Rust panic or a fatal Turbopack error. ` +
  986 |         'Pass `allowRustPanics: true` to `nextTestSetup` if this is expected.\n\n' +
  987 |         lines.slice(index, index + 1 + RUST_PANIC_CONTEXT_LINES).join('\n'),

  at NextStartInstance.throwOnRustPanics (lib/next-modes/base.ts:984:11)
  at NextStartInstance.throwOnRustPanics [as build] (lib/next-modes/next-start.ts:308:10)
  at Object.<anonymous> (production/app-dir/webpack-loader-traced-imports/webpack-loader-traced-imports.test.ts:35:26)
  at Object.gatedBody (lib/gate/runtime.ts:280:7)

pnpm test-start test/e2e/app-dir/next-dynamic-css/next-dynamic-css.test.ts (job)

  • next-dynamic-css > should have correct order of styles on client component that is sharing styles with next/dynamic (DD)
Expand output

● next-dynamic-css › should have correct order of styles on client component that is sharing styles with next/dynamic

expect(received).toBe(expected) // Object.is equality

Expected: "rgb(0, 0, 0)"
Received: "rgb(139, 0, 0)"

  37 |       expect(
  38 |         await browser.elementByCss('#inner2').getComputedCss('color')
> 39 |       ).toBe('rgb(0, 0, 0)')
     |         ^
  40 |     })
  41 |   }
  42 |

  at Object.toBe (e2e/app-dir/next-dynamic-css/next-dynamic-css.test.ts:39:9)

pnpm test-dev-turbo test/e2e/app-dir/next-analyze-source-maps/next-analyze-source-maps.test.ts (turbopack) (job)

  • next analyze source maps > preserves emitted assets with none source maps (DD)
  • next analyze source maps > preserves emitted assets with full source maps (DD)
Expand output

● next analyze source maps › preserves emitted assets with none source maps

expect(received).toEqual(expected) // deep equality

- Expected  -  2
+ Received  + 71

- ObjectContaining {
-   "exitCode": 0,
+ Object {
+   "cliOutput": "▲ Next.js 16.5.0-canary.61 (Turbopack)
+ ✓ Running next.config.js took 35ms
+ - Experiments (use with caution):
+   ✓ strictRouteTypes (enabled by `__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES`)
+   ⨯ turbopackInputSourceMaps
+   ⨯ turbopackSourceMaps
+
+   Creating an optimized production build ...
+
+ thread 'tokio-rt-worker' (63727) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
+ 1 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
+ stack backtrace:
+ ✓ Compiled successfully in 1341ms
+   Running TypeScript ...
+    0: __rustc::rust_begin_unwind
+    1: core::panicking::panic_fmt
+    2: napi::tokio_runtime::execute_future_impl::<(), next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#2}, next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#3}, napi::error::Error>::{closure#0}
+    3: <tokio::runtime::task::core::Core<napi::tokio_runtime::execute_future_impl<(), next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#2}, next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#3}, napi::error::Error>::{closure#0}, alloc::rcs::arc::Arc<tokio::runtime::scheduler::current_thread::Handle>>>::poll
+    4: <tokio::runtime::task::harness::Harness<napi::tokio_runtime::execute_future_impl<(), next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#2}, next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#3}, napi::error::Error>::{closure#0}, alloc::rcs::arc::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>>>::poll
+    5: <tokio::runtime::scheduler::multi_thread::worker::Context>::run_task
+    6: <tokio::runtime::scheduler::multi_thread::worker::Context>::run
+    7: <tokio::runtime::context::scoped::Scoped<tokio::runtime::scheduler::Context>>::set::<tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}, ()>
+    8: tokio::runtime::context::runtime::enter_runtime::<tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}, ()>
+    9: tokio::runtime::scheduler::multi_thread::worker::run
+   10: <tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}> as core::future::future::Future>::poll
+   11: <tokio::runtime::task::core::Core<tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>>::poll
+   12: tokio::runtime::task::harness::poll_future::<tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>
+   13: <tokio::runtime::task::harness::Harness<tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>>::poll_inner
+   14: tokio::runtime::task::raw::poll::<tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>
+   15: <tokio::runtime::blocking::pool::Inner>::run
+ note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
+ unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }
+ ",
+   "code": 1,
+   "exitCode": 1,
+   "signal": null,
+   "stderr": "
+ thread 'tokio-rt-worker' (63727) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
+ 1 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
+ stack backtrace:
+    0: __rustc::rust_begin_unwind
+    1: core::panicking::panic_fmt
+    2: napi::tokio_runtime::execute_future_impl::<(), next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#2}, next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#3}, napi::error::Error>::{closure#0}
+    3: <tokio::runtime::task::core::Core<napi::tokio_runtime::execute_future_impl<(), next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#2}, next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#3}, napi::error::Error>::{closure#0}, alloc::rcs::arc::Arc<tokio::runtime::scheduler::current_thread::Handle>>>::poll
+    4: <tokio::runtime::task::harness::Harness<napi::tokio_runtime::execute_future_impl<(), next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#2}, next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#3}, napi::error::Error>::{closure#0}, alloc::rcs::arc::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>>>::poll
+    5: <tokio::runtime::scheduler::multi_thread::worker::Context>::run_task
+    6: <tokio::runtime::scheduler::multi_thread::worker::Context>::run
+    7: <tokio::runtime::context::scoped::Scoped<tokio::runtime::scheduler::Context>>::set::<tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}, ()>
+    8: tokio::runtime::context::runtime::enter_runtime::<tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}, ()>
+    9: tokio::runtime::scheduler::multi_thread::worker::run
+   10: <tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}> as core::future::future::Future>::poll
+   11: <tokio::runtime::task::core::Core<tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>>::poll
+   12: tokio::runtime::task::harness::poll_future::<tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>
+   13: <tokio::runtime::task::harness::Harness<tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>>::poll_inner
+   14: tokio::runtime::task::raw::poll::<tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>
+   15: <tokio::runtime::blocking::pool::Inner>::run
+ note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
+ unhandledRejection [Error: Panic in async function] { code: 'GenericFailure' }
+ ",
+   "stdout": "▲ Next.js 16.5.0-canary.61 (Turbopack)
+ ✓ Running next.config.js took 35ms
+ - Experiments (use with caution):
+   ✓ strictRouteTypes (enabled by `__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES`)
+   ⨯ turbopackInputSourceMaps
+   ⨯ turbopackSourceMaps
+
+   Creating an optimized production build ...
+ ✓ Compiled successfully in 1341ms
+   Running TypeScript ...
+ ",
  }

  57 |         }
  58 |         const normal = await next.runCommand(['build'], { env })
> 59 |         expect(normal).toEqual(expect.objectContaining({ exitCode: 0 }))
     |                        ^
  60 |         const normalAssets = readBuildAssets()
  61 |         expect(
  62 |           Object.keys(normalAssets).some((file) => file.endsWith('.css'))

  at toEqual (e2e/app-dir/next-analyze-source-maps/next-analyze-source-maps.test.ts:59:24)

● next analyze source maps › preserves emitted assets with full source maps

expect(received).toEqual(expected) // deep equality

- Expected  -  2
+ Received  + 71

- ObjectContaining {
-   "exitCode": 0,
+ Object {
+   "cliOutput": "▲ Next.js 16.5.0-canary.61 (Turbopack)
+ ✓ Running next.config.js took 45ms
+ - Experiments (use with caution):
+   ✓ strictRouteTypes (enabled by `__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES`)
+   ✓ turbopackInputSourceMaps
+   ✓ turbopackSourceMaps
+
+   Creating an optimized production build ...
+ ✓ Compiled successfully in 1307ms
+
+ thread 'tokio-rt-worker' (66254) panicked at crates/next-napi-bindings/src/next_api/project.rs:948:5:
+ 1 idle Node.js processes are still running at shutdown, but they should have been stopped after building the module graph
+ stack backtrace:
+   Running TypeScript ...
+    0: __rustc::rust_begin_unwind
+    1: core::panicking::panic_fmt
+    2: napi::tokio_runtime::execute_future_impl::<(), next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#2}, next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#3}, napi::error::Error>::{closure#0}
+    3: <tokio::runtime::task::core::Core<napi::tokio_runtime::execute_future_impl<(), next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#2}, next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#3}, napi::error::Error>::{closure#0}, alloc::rcs::arc::Arc<tokio::runtime::scheduler::current_thread::Handle>>>::poll
+    4: <tokio::runtime::task::harness::Harness<napi::tokio_runtime::execute_future_impl<(), next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#2}, next_napi_bindings::next_api::project::project_shutdown_c_callback::{closure#0}::{closure#3}, napi::error::Error>::{closure#0}, alloc::rcs::arc::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>>>::poll
+    5: <tokio::runtime::scheduler::multi_thread::worker::Context>::run_task
+    6: <tokio::runtime::scheduler::multi_thread::worker::Context>::run
+    7: <tokio::runtime::context::scoped::Scoped<tokio::runtime::scheduler::Context>>::set::<tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}, ()>
+    8: tokio::runtime::context::runtime::enter_runtime::<tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}, ()>
+    9: tokio::runtime::scheduler::multi_thread::worker::run
+   10: <tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}> as core::future::future::Future>::poll
+   11: <tokio::runtime::task::core::Core<tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>>::poll
+   12: tokio::runtime::task::harness::poll_future::<tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>
+   13: <tokio::runtime::task::harness::Harness<tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>>::poll_inner
+   14: tokio::runtime::task::raw::poll::<tokio::runtime::blocking::task::BlockingTask<<tokio::runtime::scheduler::multi_thread::worker::Launch>::launch::{closure#0}>, tokio::runtime::blocking::sc

... truncated ...

pnpm test-start-turbo test/e2e/deferred-entries/deferred-entries.test.ts (turbopack) (job)

... truncated to fit in one GitHub comment ...

@github-actions github-actions Bot added created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js. labels Nov 22, 2026
Comment thread crates/next-api/src/project.rs Resolved
…_dropping_issues, add regression test

Use the Vc returned by resolve() (which already connects the operation)
instead of connecting again, apply the same wait to the MCP variant, and
check from runAfterProductionCompile that no loader processes outlive
compilation.
@github-actions github-actions Bot added the tests label Nov 23, 2026
Mark whole_app_module_graphs session dependent. With a warm cache, loaders
run again for changed modules, but the graph's own tasks don't execute
again, so the pool was never scaled down and their processes stayed alive
until the build exited. Also scale down when computing the graph fails.

Make the backends' scale_down/scale_zero infallible (they never failed),
and debug-assert at shutdown that no idle Node.js processes are left in
builds that don't watch the file system.
…ocesses

HeapQueue locks its heap before ACTIVE_POOLS, so release ACTIVE_POOLS
before reading the heaps, as scale_down/scale_zero already do.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by: Turbopack team PRs by the Turbopack team. tests Turbopack Related to Turbopack with Next.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant